package com.wh.springbootrabbitmq.manager;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Auther: HuiEr
 * @Date: 2020/3/15 17:25
 * @Description
 */
@Component
public class RabbitmqManager {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    final RabbitTemplate.ConfirmCallback confirmCallback=new RabbitTemplate.ConfirmCallback(){
        @Override
        public void confirm(CorrelationData correlationData, boolean b, String s) {

        }
    };

    final RabbitTemplate.ReturnCallback returnCallback=new RabbitTemplate.ReturnCallback() {
        @Override
        public void returnedMessage(Message message, int i, String s, String s1, String s2) {

        }
    };
    public void routerSend(){
        rabbitTemplate.convertSendAndReceive("router_ex","xiao","yigoumiaodasuo");
    }
}
